Skip to content

fix: Restore the feature flag in FeatureFlagsV3Test without blocking - #1418

Open
ZPascal wants to merge 1 commit into
cloudfoundry:mainfrom
ZPascal:fix-feature-flags-v3-test
Open

ZPascal wants to merge 1 commit into
cloudfoundry:mainfrom
ZPascal:fix-feature-flags-v3-test

Conversation

@ZPascal

@ZPascal ZPascal commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

FeatureFlagsV3Test.update, updateMessage and updateNothing restored app_scaling in doFinally with a nested, blocking StepVerifier.verify(...). That blocks a Reactor Netty thread while it waits for another HTTP call, so each restore timed out after 5 minutes. The class took ~600 s per run, updateMessage failed on its first attempt (VerifySubscriber timed out) and passed on the rerun, and the flag was left changed. See e.g. the v3 job of #1409 (run 44831523436) and main run 44739488637.

Changes

  • A helper withRestoredFeatureFlag reads the flag, runs the test and restores it with Mono.usingWhen, so the restore is part of the reactive chain and also runs when the test fails or is cancelled.
  • The restore sets both enabled and the custom error message. A null message is restored with clearCustomErrorMessage(true); before, updateMessage left its test message in place when the original message was null.
  • updateCustomErrorMessage and updateCustomErrorMessageToNull use the same helper.
  • Boolean values are compared with equals instead of ==/!=.

Testing

  • ./mvnw -Pintegration-test -DskipTests spotless:check install passes.
  • The integration test itself runs in this PR's CI.

5.x.x

5.x.x already restores the flag reactively (flatMap(...).thenReturn(...)), so it doesn't hang there and needs no backport.

update, updateMessage and updateNothing restored app_scaling in doFinally
with a nested, blocking StepVerifier.verify. That blocked a reactor thread
while it waited for another HTTP call, so each restore timed out after 5
minutes, updateMessage failed on its first run and the flag was left
changed.

All update tests now run inside Mono.usingWhen, which restores the enabled
state and the custom error message as part of the same reactive chain, also
when the test fails. A null custom error message is restored by clearing it,
the old code left the test message in place.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant